class BoardController < ApplicationController
  verify :method => :post, :only => [ :destroy, :create, :update ],
         :redirect_to => { :action => :list }

  in_place_edit_for :board, :title 
  in_place_edit_for :board, :description

  def index
    redirect_to :controller => "section", :action => "index"
  end

  def show
    @board = Board.find(params[:id])
    @discussions = @board.discussions
  rescue ActiveRecord::RecordNotFound
    logger.error "Tried to read not existent board #{params[:id]}"
    flash[:warning] = "Selected board (#{params[:id]}) is not a valid board."
    redirect_to :controller => 'section', :action => "index"
  end

  def set_board_section
    @board = Board.find(params[:id])
    @section = Section.find(params[:value])
    @board.section = @section
    @board.save
    render :text => @board.section.title
  rescue ActiveRecord::RecordNotFound
    render :text => @board.section.title
  end

  def new
  end

  def create
  end

  def edit
    
  end

  def update
  end

  def destroy
  end
end
